package com.flyan.game.motafx.entity.monster;

import com.flyan.game.motafx.core.enums.EntityClassifyEnum;
import com.flyan.game.motafx.core.enums.EntityTypeEnum;
import com.flyan.game.motafx.core.pojo.LifePanel;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.flyan.game.motafx.core.enums.EntityTypeEnum.*;

/**
 * 怪物表
 *
 * @author flyan
 * @version 1.0
 * @email flyan_by_chenu@sina.com
 * @since 2025/2/9
 */
public class MonsterTable {

    private final Map<EntityTypeEnum, MonsterInfo> table;

    public MonsterTable() {
        List<EntityTypeEnum> monsterTypes = EntityTypeEnum.getByClassify(EntityClassifyEnum.MONSTER);
        this.table = new HashMap<>(monsterTypes.size());
        table.put(MONSTER_GREEN_SLIME, new MonsterInfo() {{
            setType(MONSTER_GREEN_SLIME);
            setName(MONSTER_GREEN_SLIME.getName());
            setLifePanel(new LifePanel(35, 18, 1, 1));
        }});
        table.put(MONSTER_RED_SLIME, new MonsterInfo() {{
            setType(MONSTER_RED_SLIME);
            setName(MONSTER_RED_SLIME.getName());
            setLifePanel(new LifePanel(45, 20, 2, 2));
        }});
        table.put(MONSTER_BLACK_SLIME, new MonsterInfo() {{
            setType(MONSTER_BLACK_SLIME);
            setName(MONSTER_BLACK_SLIME.getName());
            setLifePanel(new LifePanel(130, 60, 3, 8));
        }});
        table.put(MONSTER_SLIME_KING, new MonsterInfo() {{
            setType(MONSTER_SLIME_KING);
            setName(MONSTER_SLIME_KING.getName());
            setLifePanel(new LifePanel(360, 310, 20, 40));
        }});
        table.put(MONSTER_LITTLE_BAT, new MonsterInfo() {{
            setType(MONSTER_LITTLE_BAT);
            setName(MONSTER_LITTLE_BAT.getName());
            setLifePanel(new LifePanel(35, 38, 3, 3));
        }});
        table.put(MONSTER_GIANT_BAT, new MonsterInfo() {{
            setType(MONSTER_GIANT_BAT);
            setName(MONSTER_GIANT_BAT.getName());
            setLifePanel(new LifePanel(60, 100, 8, 12));
        }});
        table.put(MONSTER_RED_BAT, new MonsterInfo() {{
            setType(MONSTER_RED_BAT);
            setName(MONSTER_RED_BAT.getName());
            setLifePanel(new LifePanel(200, 390, 90, 50));
        }});
        table.put(MONSTER_VAMPIRE, new MonsterInfo() {{
            setType(MONSTER_VAMPIRE);
            setName(MONSTER_VAMPIRE.getName());
            setLifePanel(new LifePanel(400, 140, 20, 30));
        }});
        table.put(MONSTER_SKELETON_MAN, new MonsterInfo() {{
            setType(MONSTER_SKELETON_MAN);
            setName(MONSTER_SKELETON_MAN.getName());
            setLifePanel(new LifePanel(50, 42, 6, 6));
        }});
        table.put(MONSTER_SKELETON_SOLDIER, new MonsterInfo() {{
            setType(MONSTER_SKELETON_SOLDIER);
            setName(MONSTER_SKELETON_SOLDIER.getName());
            setLifePanel(new LifePanel(55, 52, 12, 8));
        }});
        table.put(MONSTER_SKELETON_CAPTAIN, new MonsterInfo() {{
            setType(MONSTER_SKELETON_CAPTAIN);
            setName(MONSTER_SKELETON_CAPTAIN.getName());
            setLifePanel(new LifePanel(100, 65, 15, 30));
        }});
        table.put(MONSTER_JUNIOR_MAGE, new MonsterInfo() {{
            setType(MONSTER_JUNIOR_MAGE);
            setName(MONSTER_JUNIOR_MAGE.getName());
            setLifePanel(new LifePanel(60, 32, 8, 5));
        }});
        /* 芝诺 */
        table.put(MONSTER_RED_ZENO, new MonsterInfo() {{
            setType(MONSTER_RED_ZENO);
            setName(MONSTER_RED_ZENO.getName());
            setLifePanel(new LifePanel(60, 32, 8, 5));
        }});
    }

    public MonsterInfo get(EntityTypeEnum monsterType) {
        return table.get(monsterType);
    }

}
